home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.Color;
- import java.awt.Component;
- import java.net.URL;
-
- public class StatusBarScroller2 extends Applet implements Runnable {
- private String text;
- // $FF: renamed from: wi int
- private int field_0;
- // $FF: renamed from: he int
- private int field_1;
- private Thread thread;
- private int pause = 50;
-
- public String getAppletInfo() {
- return "Name: StatusBarScroller2\r\nAuthor: Taiji Software\r\n";
- }
-
- public void register() {
- try {
- URL u = new URL("http://www.taijisoftware.com");
- ((Applet)this).getAppletContext().showDocument(u, "_blank");
- } catch (Exception e) {
- System.out.println(e);
- this.stop();
- }
- }
-
- public void init() {
- String codeBase = null;
-
- try {
- codeBase = (new URL(((Applet)this).getCodeBase().toString())).getHost();
- System.out.println("Copyright 1999, 2001 Taiji Software(tm)\nYour domain name is : " + codeBase);
- codeBase = codeBase.toUpperCase();
- } catch (Exception var9) {
- }
-
- if (!((Applet)this).getCodeBase().toString().toUpperCase().startsWith("FILE") || ((Applet)this).getParameter("debug") != null) {
- String regCode = ((Applet)this).getParameter("registration_code");
- if (regCode == null) {
- regCode = ((Applet)this).getParameter("reg_domain");
- if (regCode == null) {
- this.register();
- } else {
- if (regCode.length() == codeBase.length() + 4 && !codeBase.startsWith("WWW.")) {
- codeBase = "WWW." + codeBase;
- } else if (regCode.length() == codeBase.length() - 4 && codeBase.startsWith("WWW.")) {
- codeBase = codeBase.substring(4);
- }
-
- char[] chars = new char[codeBase.length()];
- codeBase.getChars(0, codeBase.length(), chars, 0);
- String key = new String("haricot");
- char[] chars2 = new char[key.length()];
- key.getChars(0, key.length(), chars2, 0);
-
- for(int i = 0; i < codeBase.length(); ++i) {
- int j;
- if (i >= key.length()) {
- j = i - key.length() * (i / key.length());
- } else {
- j = i;
- }
-
- chars[i] += chars2[j];
- chars[i] = (char)(chars[i] - chars[i] / 26 * 26 + 97);
- }
-
- String res = new String(chars);
- if (!res.equalsIgnoreCase(regCode)) {
- this.register();
- }
- }
- } else if (!regCode.equals("settevercsedegnamiaj") && !regCode.equals("8078")) {
- this.register();
- }
- }
-
- this.field_0 = ((Component)this).getSize().width;
- this.field_1 = ((Component)this).getSize().height;
- String s = ((Applet)this).getParameter("pause");
- if (s != null) {
- this.pause = Integer.parseInt(s);
- }
-
- this.text = ((Applet)this).getParameter("text");
- ((Component)this).setBackground(this.getColor("background_color"));
- this.thread = new Thread(this);
- this.thread.start();
- }
-
- public Color getColor(String param) {
- String s = ((Applet)this).getParameter(param);
- if (s != null) {
- if (s.substring(0, 1).equals("#")) {
- s = s.substring(1);
- int i = Integer.parseInt(s, 16);
- return new Color(i);
- } else {
- return null;
- }
- } else {
- return null;
- }
- }
-
- public void run() {
- int c = 0;
-
- int m;
- for(m = 0; (c = this.text.indexOf("#", c)) != -1; ++m) {
- ++c;
- }
-
- String[] lines = new String[m + 1];
- if (m != 0) {
- int[] index = new int[m];
-
- for(m = 0; (c = this.text.indexOf("#", c)) != -1; ++m) {
- index[m] = c;
- if (m == 0) {
- lines[m] = this.text.substring(0, index[0]);
- } else {
- lines[m] = this.text.substring(index[m - 1] + 1, index[m]);
- }
-
- ++c;
- }
-
- lines[m] = this.text.substring(index[m - 1] + 1);
- } else {
- lines[m] = this.text;
- }
-
- int l = 1;
- int L = 0;
- int P = 0;
-
- while(true) {
- try {
- ((Applet)this).showStatus(lines[L].substring(0, l));
- Thread.sleep(20L);
- } catch (Exception var8) {
- }
-
- P += 20;
- if (P > this.pause) {
- ++l;
- if (l >= lines[L].length() + 1) {
- l = 0;
-
- try {
- Thread.sleep(1000L);
- } catch (Exception var7) {
- }
-
- ++L;
- if (L > m) {
- L = 0;
- }
- }
-
- P = 0;
- }
- }
- }
-
- public void start() {
- if (this.thread == null) {
- this.thread = new Thread(this);
- this.thread.start();
- }
-
- }
-
- public void stop() {
- if (this.thread != null) {
- this.thread = null;
- }
-
- }
- }
-